package com.goven.server.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.goven.server.dto.AccountDto;

public interface AccountDao {
	
	@Insert({
		"insert into sys_users (ACCOUNT,NAME,GENDER,PHONE,EMAIL,IDCARD,PASSWORD,DATA_STATUS,DATA_VERSION)"
		+"VALUES (#{account,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{gender,jdbcType=INTEGER},#{phone,jdbcType=VARCHAR},#{email,jdbcType=VARCHAR},#{idCard,jdbcType=VARCHAR},#{password,jdbcType=VARCHAR},1,1)"
	})
	public int add(AccountDto data);
	@Update({
		"UPDATE sys_users D SET D.EMAIL=#{email,jdbcType=VARCHAR} , D.PHONE = #{phone,jdbcType=VARCHAR}",
		"WHERE D.ACCOUNT=#{account,jdbcType=VARCHAR}"
	})
	public int update(AccountDto data);
	@Select("SELECT * FROM sys_users WHERE ID=#{id,jdbcType=DECIMAL}")
	public AccountDto get(int id);
	@Select("SELECT * FROM sys_users WHERE ID=#{id,jdbcType=DECIMAL}")
	public List<AccountDto> queryList(AccountDto param);

}
